//alert('plugins 1');

plugins = new function () {

    this.alert = function () {
        alert(' this alert ');
    };

    this.getInfo = function (successCallback, errorCallback) {
        //alert('11');
        cordova.exec(successCallback, errorCallback, "plugins", "getDeviceInfo", []);
    };

    this.loginfb = function (successCallback, errorCallback) {
        //alert('11');
        cordova.exec(successCallback, errorCallback, "plugins", "loginfb", []);
    };

}

//plugins.alert();

//listen_native();

function listen_native(param) {
    alert('listen: ' + param);
}

/*function send_tokenkey(key) {
    User.tokenkey = key;
    var userid = null;
    if (User.isLogin()) {
        userid = User.id;
    }
    var link = _this.Base_Api + 'get-key?user_id=' + userid + '&key=' + key + '&type=1';
    if (key != "") {
        $.ajax({
            url: link,
            type: "GET",
            timeout: 11000,
            data: null,
            success: function (data) {
                //console.log(data); //nếu unchange thì lấy từ db change thì lấy ol
                // alert('success: '+link);
            },
            error: function (e) {
                //console.log('go offline to get story lits');
                // alert('fail');
            }
        });
    }
}*/
/*
 setTimeout(function(){
 plugins.getInfo(function(value){alert(value+'123');}, function(value){alert(value+'123');});
 window.open("http://www.w3schools.com", "_blank", "toolbar=yes, scrollbars=yes, resizable=yes,  width=200, height=400");
 //window.location.href='http://apache.org';
 },2000);
 
 */
/*
 
 window.echo = function(str, callback) {
 cordova.exec(callback, function(err) {
 callback('Nothing to echo.');
 }, "Echo", "echo", [str]);
 };
 */